# Instructions to replicate analyses in
# Kline, Bankert, Levitan, Kraft. 2017.
# "Personality and Prosocial Behavior: A Multilevel Meta-Analysis"

This replication folder contains the following files:

1) MASTER.R:          installs required packages and runs main scripts (2 & 3)
2) MLMA_estimation.R: estimate models via RStan
3) MLMA_summary.R:    produce tables and plots (for main text and appendix)
4) mlma.stan:         main model specification
5) mlma_logit.stan:   alternative model specification (logit)
6) mlma_slope.stan:   alternative model specification (random slope)
7) mlma_data.dta:     dataset including all studies
8) MASTER.Rout:       log file ($ R CMD BATCH MASTER.R)

## NOTES:
- please set the working directory in MASTER.R before runnning the script
- MLMA_estimation.R and MLMA_summary.R can also be executed individually
- the RStan package has additional prerequisites to run on your system
  (RTools, g++ compiler, etc.), for more information please check
  https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started
- producing RStan traceplots via ggplot for the appendix resulted in errors on
  some systems. If that is the case, please try updating RStan and/or ggplot.
  If an update does not solve the issue, MLMA_summary.R also contains code to
  produce traceplots using the coda package and base R graphics.

